<template>
  <div class="main-boxs">
		<div class="top-boxs">
			<Header
			  :height="headerHeight"
			  type="admin"
				@reload="reload"
			/>
		</div>
		<div class="bottom-boxs">
			<div class="slider-boxs">
			  <slider :menus="menus" />
			</div>
			<div class="content-boxs">
				<Tabs type="admin" :show-home-tab="false" />
				<div class="view-box">
					<template v-if="isRouterAlive">
						<keep-alive>
							<router-view v-if="$route.meta.keepAlive" />
						</keep-alive>
						<router-view v-if="!$route.meta.keepAlive" />
					</template>
				</div>
			</div>
		</div>
  </div>
</template>

<script>
import slider from 'components/slider'
import Header from 'components/header'
import Tabs from 'components/tabs'
import { menuList } from '@/router/menuList'

export default {
  name: 'AdminMain',
  components: {
    slider,
    Header,
		Tabs
  },
  data() {
    return {
      headerHeight: 64,
      isRouterAlive: true,
      menus: []
    }
  },
  computed: {
  },
  watch: {
  },
  mounted() {
		//this.menus = Object.assign([], this.commonData.menusList[0].menuVOList) // 从VUEX中获取菜单
		this.menus = menuList // 从静态文件获取菜单
  },
  methods: {
		reload() {
		  this.$hint.hint('刷新中，请稍等...')
		  this.isRouterAlive = false
		  this.$nextTick(() => {
		    this.isRouterAlive = true
		  })
		},
  }
}
</script>

<style lang="scss" scoped>

</style>
